<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
      var a = document.getElementsByTagName('')
    </script>
</head>
<?php
      $n1 ='';
      $n2 ='';
      $result ='';
      if(isset($_POST['number'])&&$_POST['number2']){
      $n1 = $_POST['number'];
      $n2 = $_POST['number2'];
      $result = $n1 + $n2;
     
      echo "求和为：",$result;
     
      }
    ?> 
    
<body>
    <!-- action留空表示提交给自己 -->
    <form action="" method="POST">
        数字1：<input type="text" name="number" value="<?php echo $n1; ?>">
        +
        数字2：<input type="text" name="number2" value="<?php echo $n2;?>">
        
        <input type="submit" value="=">
        <input type="text" value="<?php echo $result; ?>">
    </form>
</body>
</html>